"""MyDjango URL Configuration

The `urlpatterns` list routes URLs to views. For more information please see:
    https://docs.djangoproject.com/en/4.1/topics/http/urls/
Examples:
Function views
    1. Add an import:  from my_app import views
    2. Add a URL to urlpatterns:  path('', views.home, name='home')
Class-based views
    1. Add an import:  from other_app.views import Home
    2. Add a URL to urlpatterns:  path('', Home.as_view(), name='home')
Including another URLconf
    1. Import the include() function: from django.urls import include, path
    2. Add a URL to urlpatterns:  path('blog/', include('blog.urls'))
"""
from django.contrib import admin
from django.urls import path

import manage.views
from django.conf import settings
from django.conf.urls.static import static
from MyDjango.views import home_view

urlpatterns = [
    path('admin/', admin.site.urls),
    path('',home_view,name="home"),
    path('index/',manage.views.index),
    path('login/', manage.views.login),
    path('logout/', manage.views.logout),
    path('test/', manage.views.test),
    path('user/add/', manage.views.user_add),
    path('user/doadd/', manage.views.user_doadd),
    path('user/list/', manage.views.user_list),
    path('user/del/', manage.views.user_del),
    path('user/edit/', manage.views.user_edit),
    path('upload_img/', manage.views.upload_img),
    path('user_category/', manage.views.user_category),
    path('get_category/', manage.views.get_category),
    ] + static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT) # 需要添加此设置，否则外加无法图片
